package com.uuticketweb.ticket.flight.service.factory;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.uuticketweb.ticket.flight.service.OrderService;

public class OrderServiceFactory {
	
	public static OrderService orderService = null;
	public static synchronized OrderService getOrderService(){
		if(orderService == null){
			ApplicationContext ct = WebApplicationContextUtils.getWebApplicationContext(
					ServletActionContext.getServletContext());
			orderService = (OrderService)ct.getBean("orderService");
		}
		return orderService;
	}
}
